<template>
  <div>
    <pstep :stepData="stepData" :doneNum="doneNum"  style="margin-bottom: 20px;"></pstep>
    <!-- 第一步 -->
    <div v-show="doneNum===1">
      <pform ref="form" :model="form" lw="130">
        <el-form-item label="进程名称">
          <el-input
            placeholder="请输入"
            style="width:233px;"
            v-model="form.field1">
          </el-input>
        </el-form-item>
        <el-form-item label="进程路径">
          <el-input
            placeholder="请输入"
            style="width:233px;"
            v-model="form.field2">
          </el-input>
        </el-form-item>
        <el-form-item label="目标主机">
          <el-input
            placeholder="请输入内容"
            suffix-icon="el-icon-search"
            style="width:233px;"
            v-model="form.field3">
          </el-input>
        </el-form-item>
        <el-form-item label="">
          <plist ref="pList" :tableData="tableData" :tableColumn="tableColumn" :hasIndex="false" :hasRadioSelect="true">
          </plist>
        </el-form-item>
      </pform>
      <div class="step-btn-box">
        <el-button type="primary" @click="handleAdd">立即创建</el-button>
      </div>
    </div>

  </div>
</template>
<script>
import plist from "@/components/publicList";
import pstep from '@/components/publicStep'
export default {
  name: "主机入侵防御创建",
  components: {pstep,plist},
  data(){
    return {
      stepData:[{num:1,nameIn:'1',nameOut:'基础配置'}
        // ,{num:2,nameIn:'2',nameOut:'确认信息'},
      ],
      doneNum:1,
      form:{
        field2:'1'
      },
      tableData:[],
      showColumn: [],
      tableColumn: [
        {
          field: "code",
          width: "50"
        },
        {
          field: "hostName",
          label: "主机名",
          width: "220"
        },
        {
          field: "ipAddress",
          label: "IP地址",
          width: "220"
        },
        {
          field: "agent",
          label: "Agent",
        },
      ],
    }
  },
  created() {
    this.init();
  },
  methods:{
    init(){
      this.$nextTick(()=>{
        this.tableData = [
          {code:1,hostName:"physical.o3",ipAddress:"14.56.3.2",agent:"1.0.1"},
          {code:2,hostName:"physical.o3",ipAddress:"14.156.3.2",agent:"1.0.2"},
          {code:3,hostName:"physical.o3",ipAddress:"14.516.3.2",agent:"1.0.2"},
        ]
        this.$refs.pList.selectCode=1;
      })
    },
    handleAdd(){
        this.$router.push({path:'/hostSecurity/processWhitelist'})
    },
    radioSelect(row){
      console.info(row)
    }
  }
}
</script>
<style scoped lang="less">
.step-btn-box{
  margin-top: 10px;
}
</style>
